<?php
class rcmController extends RPHP_Controller
{

    public function index()
    {

        if ($_GET['recode'] != "") {
            $recode = intval($_GET['recode']);
            if ($recode > 0) {
                $_SESSION['qrcode_recode'] = $recode;
            }
        }

        $m    = $this->model;
        $user = $m->checkAuth();
        if ($user) {
            $user         = $m->getMember();
            $user['ximi'] = $m->getXimiMoney();

            $this->view->user = $user;

            // print_r($user);

            //$this->view->level_type = $m->getMember()['level_type'];
             $this->view->JSAPI = $m->getJSApiData();
            $this->view->config = $m->getSetting();
            $this->view->category = $m->getCategory();

            $this->display();
        }

    }

    public function ajax()
    {
        $m            = $this->model;
        $data['code'] = 900;
        if ($_POST['act'] == "getlist") {

        $page = intval($_POST['page']);
        if ($page < 1) {
            $page = 1;
        }

        $data = $m->getGoodsList($_POST, $page);
        // print_r($data);die;
    }
    else if ($_POST['act'] == "getCateSon"){


        $data = $m->getCateSon($_POST['caid']);
        // print_r($data);die;
    }

        echo json_encode($data);
    }

}
